package com.weiwu.weiwustore.controller;

import com.weiwu.weiwustore.pojo.RestResponse;
import com.weiwu.weiwustore.service.MenusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class MenuController {
    @Autowired
    private MenusService menuService;
    @PostMapping("/menu/getmenus")
    public RestResponse getmenus(@RequestBody Map<String,String> map) {
        return new RestResponse(menuService.getMenuByAuthority(map));
    }
    @GetMapping("/menu/getmenulist")
    public RestResponse getmenulist() {
        return new RestResponse(menuService.getMenulist());
    }
    @PostMapping("/menu/getmenusbyroleid")
    public RestResponse getmenusbyroleid(@RequestBody Map<String,String> map) {
        return new RestResponse(menuService.getmenusbyroleid(map));
    }

}
